<div class="todolist">
  <div class="head">Angular&nbsp;&nbsp;TodoList</div>
  <form #f="ngForm" class="inputSearch">
    <input
      type="text"
      placeholder="add todo"
      name="username"
      [(ngModel)]="username"
      class="input"
    />
    <button class="mgl16px button" (click)="onSubmit()">添加</button>
  </form>
  <div class="doList" *ngIf="list.length > 0">
    <ul>
      <li *ngFor="let item of list; let i = index" class="listItem">
        <div class="left">
          <input type="checkbox" ng-value="item.status" />
          <div class="text">
            {{ item.listname }}
          </div>
        </div>

        <button class="mgl16px button" (click)="deleteItem(i)">删除</button>
      </li>
    </ul>
  </div>
</div>
